package org.linlinjava.litemall.db.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.LitemallMessage;
import org.linlinjava.litemall.db.domain.LitemallChatSession;
import java.util.List;

@Mapper
public interface LitemallMessageMapper {
    int insert(LitemallMessage message);

    List<LitemallMessage> selectList(@Param("userId") String userId,
                                     @Param("partnerId") String partnerId,
                                     @Param("offset") Integer offset,
                                     @Param("limit") Integer limit,
                                     @Param("productId") Integer productId);

    int countUnread(@Param("userId") String userId,
                    @Param("partnerId") String partnerId);

    int markRead(@Param("userId") String userId,
                 @Param("partnerId") String partnerId);

    /**
     * 查询聊天会话列表
     */
    List<LitemallChatSession> selectChatList(String userId);
}